function myall(arr) {
    let res = [],count = 0
    return new Promise((resolve, reject) => {
        arr.forEach(item => {
            item.then(res1 => {
                count += 1
                res.push(res1)
                if(count == arr.length) resolve(res)
            })
            .catch(err => {
                    reject(err)
                })
        })
    })
}



let a = new Promise((resolve, reject) => {
    resolve('a')
})

let b = new Promise((resolve, reject) => {
    resolve('b')
})

let c = new Promise((resolve, reject) => {
    resolve('c')
})
Promise.all([a, b, c]).then(res => console.log(res))

let test = myall([a, b, c])
test.then(res => console.log(res))
console.log(test);